package com.example.demo.user.service.serviceIml;

import com.example.demo.user.dao.UserDao;
import com.example.demo.user.entity.User;
import com.example.demo.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceIml implements UserService {

    @Autowired
    private UserDao userDao;

    /**
     * 增加用户
     * @param user
     * @return
     */
    @Override
    public int insertUser(User user) {
        return userDao.insertUser(user);
    }

    /**
     * 删除用户
     * @param id
     * @return
     */
    @Override
    public int deleteUser(int id) {
        return userDao.deleteUser(id);
    }

    /**
     * 更新用户
     * @param user
     * @return
     */
    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    /**
     * 查询全部用户
     * @return
     */
    @Override
    public List<User> selectAllUser() {
        return userDao.selectAllUser();
    }
}
